<template>
	<view style="padding: 0 20rpx;">
		<view class="list" v-for="(item,index) in list" :key="index" @click="godetails(item.id)">
			<view class="content">
				<view class="trash" style="background-color: coral;" v-if="item.labelType == '2'">
					Brandnew
				</view>
				<view class="trash" style="background-color: red;" v-if="item.labelType == '3'">
					Valuable
				</view>
				<view class="trash" style="background-color: deepskyblue;" v-if="item.labelType == '1'">
					Promotion
				</view>
				<view class="trash" style="background-color:forestgreen;" v-if="item.labelType == '4'">
					On Top
				</view>
				<view class="image">
					<image :src="item.logo" mode=""></image>
					<view class="card">
						{{item.listLabel || 'empty'}}
					</view>
				</view>
				<view class="info">
					<view class="title">{{item.name || 'none'}}</view>
					<view class="mintitle">#{{'none'}}</view>
					<view class="rate">
						<view class="">
							<u-rate count="5" size="15" readonly v-model="item.stars"></u-rate>
						</view>
						<view class="text">{{item.stars}}</view>
					</view>
					<view class="address">
						<view class="image">
							<image src="/static/address.png" mode="widthFix"></image>
						</view>
						<view class="text">
							{{item.address|| 'none'}}
						</view>
					</view>
					<view class="distance">
						<view class="image">
							<image src="/static/distance.png" mode="widthFix"></image>
						</view>
						<view class="text">
							{{item.distance|| 'none'}}
						</view>
					</view>
					<view class="mu">
						<view class="image">
							<image src="/static/mu.png" mode=""></image>
						</view>
						<view class="text">
							{{item.showNum}}
						</view>
					</view>
				</view>
			</view>
		</view>
		<view v-show="list.length > 0" style="padding-bottom: 20rpx;">
			<u-loadmore :status="status" :nomore-text="nomoreText" fontSize="12" color="#999" />
		</view>
	</view>
</template>

<script>
	export default {
		name: "bizlist",
		data() {
			return {
				value: 5,
				status: 'nomore',
				nomoreText: 'The End',
				id: 0
			};
		},
		created() {
			console.log(this.list)
			if (this._i18n.locale == 'zh') {
				this.nomoreText = '没有更多了'
			} else {
				this.nomoreText = 'The End'
			}
		},
		props: {
			list: {
				type: Array,
				default: []
			},
		},
		methods: {
			godetails(id) {
				console.log(id)
				uni.navigateTo({
					url: '/pages/Business/details/index?id=' + id
				})
			},
		}
	}
</script>

<style lang="scss">
	.list {
		margin-top: 20rpx;
		padding: 20rpx;
		background-color: #ffffff;

		border-radius: 10rpx;

		.content {
			display: flex;
			position: relative;

			.trash {
				padding: 5rpx 20rpx;
				background-color: #00aaff;
				position: absolute;
				right: 0;
				top: 20%;
				border-radius: 20rpx;
				font-size: 24rpx;
				color: #fff;
			}
		}

		.mu {
			position: absolute;
			right: 20rpx;
			bottom: 0rpx;
			display: flex;
			align-items: center;

			.image {
				image {
					width: 25rpx;
					height: 23rpx;
				}
			}

			.text {
				margin-left: 5rpx;
				font-size: 24rpx;
				color: #999;
			}
		}

		.sj {
			display: flex;
			justify-content: space-between;
			border-radius: 5rpx;
			margin-top: 10rpx;

			.sj-text {
				background-color: #f8f8f8;
				width: 46%;
				padding: 2rpx 10rpx;
				color: #999;
				font-size: 24rpx;
			}
		}

		.info {
			margin-left: 20rpx;

			.address {
				height: 22rpx;
				display: flex;
				align-items: center;
				margin-top: 10rpx;

				.image {
					image {
						width: 18rpx;

					}
				}

				.text {
					width: 500rpx;
					font-size: 24rpx;
					color: #999;
					overflow: hidden;
					white-space: nowrap;
					text-overflow: ellipsis;
					-o-text-overflow: ellipsis;
					margin-left: 5rpx;
				}
			}

			.distance {
				height: 22rpx;
				display: flex;
				align-items: center;
				margin-top: 15rpx;

				.image {
					image {
						width: 18rpx;

					}
				}

				.text {
					width: 80%;
					font-size: 24rpx;
					color: #999;
					overflow: hidden;
					white-space: nowrap;
					text-overflow: ellipsis;
					-o-text-overflow: ellipsis;
					margin-left: 5rpx;
				}
			}

			.mintitle {
				font-size: 24rpx;
				color: #00aaff;
				padding: 2rpx 10rpx;
				background-color: #f8f8f8;
				display: inline-block;
				border-radius: 20rpx;
			}

			.title {
				width: 500rpx;
				font-weight: 600;
				font-size: 28rpx;
				overflow: hidden;
				white-space: nowrap;
				text-overflow: ellipsis;
				-o-text-overflow: ellipsis;
			}

			.rate {
				display: flex;
				align-items: center;

				.text {
					font-size: 24rpx;
					color: red;
					margin-left: 5rpx;
				}
			}


		}

		.image {
			image {
				width: 130rpx;
				height: 130rpx;
				border-radius: 10rpx;
				margin-top: 10rpx;
			}
		}

		.card {
			width: 130rpx;
			height: 35rpx;
			background-color: #ff6378;
			border-radius: 30rpx;
			margin-top: 5rpx;
			font-size: 24rpx;
			text-align: center;
			line-height: 35rpx;
			color: #ffffff;
		}
	}
</style>
